package atom.scenarios.ui 
{
	import atom.loader.types.AssetLoader;
	import atom.loader.types.AssetMultimedia;
	import atom.loader.types.AssetTypes;
	import atom.ui.components.input.Button;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.utils.getDefinitionByName;
	
	/**
	 * ...
	 * @author Jorge Braccini
	 */
	public class DefaultButton extends Button {
		
		private var _asset:MovieClip;
		
		public function DefaultButton(init:Object=null) {
			super(init);
			
		}
		
		override protected function initialize():void {
			super.initialize();
			
			var asset:AssetLoader = new AssetMultimedia("bg", "assets/AtomUI-DefaultAssets.swf");
				asset.addEventListener(Event.COMPLETE, handleAssetLoaded);
				asset.load();
			
			init
			
		}
		
		private function handleAssetLoaded(e:Event):void {
			var AssetButton:Class = e.target.content.loaderInfo.applicationDomain.getDefinition("Asset_DefaultButton");
			
			_asset = new AssetButton();
			addChild(_asset);
		}
		
	}

}